﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Equation.Enterprise.Utilities.Caching
{
    public class CacheServiceFactory : ICacheServiceFactory
    {
        public ICacheService GetCacheService()
        {
            return GetCacheService(CacheType.InMemoryCache, string.Empty, string.Empty);
        }

        public ICacheService GetCacheService(CacheType cacheType)
        {
            return GetCacheService(cacheType, string.Empty, string.Empty);
        }

        public ICacheService GetCacheService(CacheType cacheType, string cacheDirectory)
        {
            return GetCacheService(cacheType, cacheDirectory, string.Empty);
        }

        public ICacheService GetCacheService(CacheType cacheType, string cacheDirectory, string cacheManagerName)
        {
            switch(cacheType)
            {
                case CacheType.InMemoryCache:
                    return new InMemoryCache(cacheDirectory, cacheManagerName);
                    break;
                default:
                    return new InMemoryCache(cacheDirectory, cacheManagerName);
            }
        }
    }

    public enum CacheType
    {
        InMemoryCache
    }
}
